<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    手机号码：<input type="number"> <button>发送</button>
    <script>
        // 按钮点击后会禁用按钮 设置disabled 为true
        // button 里面的内容通过innerHT修改
        // 设置定时器修改时间
        var btn = document.querySelector('button');
        btn.addEventListener('click', function() {
            btn.disabled = true;
            var time = 3;
            var timer = setInterval(function() {
                if (time == 0) {
                clearInterval(timer);
                btn.disabled = false;
                btn.innerHTML = '发送';
                } else {
                    btn.innerHTML = '还剩下' + time + '秒';
                    time--;
                }
            },1000);
        })
    </script>
</body>
</html>